{# vim: set et ts=8 sts=4 sw=4 ai ft=jinja.html: #}
{% extends "settings.html" %}
{% block content %}
{##}
<div class="card m-auto m-lg-20">
<div class="mw-full">
    <form action="{{ url_for("admin_content_and_editing") }}" method="POST">
<h2 class="card-title">Content and Editing Preferences</h2>
    <div class="form-group">
        <label for="commit_message" class="required">Commit message</label>
        <select class="form-control w-md-400" id="commit_message" name="commit_message">
{% for mode in [("REQUIRED", "Required"),("OPTIONAL","Optional (empty commit messages are allowed)"),("DISABLED", "Disabled (Changes saved without a commit message)")] %}
            <option value="{{mode[0]}}"{%if config.COMMIT_MESSAGE == mode[0] %} selected="selected"{%endif%}>{{mode[1]}}</option>
{% endfor %}
        </select>
    </div>
{##}
    <div class="form-group">
      <div class="custom-checkbox">
        <input {%if config.RETAIN_PAGE_NAME_CASE %}checked{% endif %} type="checkbox" id="retain_page_name_case"
          name="retain_page_name_case"
          value="True">
        <label for="retain_page_name_case">Retain page name case.</label>
        <div class="mt-5">
            Enable this to retain upper and lower case of the page name in the filename used for storing the page. <strong>Important:</strong> If pages are created while this mode is active, they may not be found as soon as the mode is deactivated again. Make sure to rename the pages to all lowercase before deactivation.
        </div>
      </div>
    </div>
{##}
    <div class="form-group">
      <div class="custom-checkbox">
        <input {%if config.TREAT_UNDERSCORE_AS_SPACE_FOR_TITLES %}checked{% endif %} type="checkbox" id="treat_underscore_as_space_for_titles"
          name="treat_underscore_as_space_for_titles"
          value="True">
        <label for="treat_underscore_as_space_for_titles">Treat underscore as space for titles.</label>
        <div class="mt-5">
            Enable this to replace underscores (_) with spaces in page titles, breadcrumbs, and page index. For example, "Page_With_Underscores" will be displayed as "Page With Underscores".
        </div>
      </div>
    </div>
{##}
    <div class="form-group">
      <div class="custom-checkbox">
        <input {%if config.GIT_WEB_SERVER %}checked=checked{% endif %} type="checkbox" id="git_web_server" name="git_web_server" value="True">
        <label for="git_web_server">Enable Git Web server <span class="text-secondary-dm bg-secondary-lm">(Experimental Feature)</span>.</label>
        <div class="mt-5">
            Enable this to allow users with the permission to READ to clone and pull the wiki content via git and users with UPLOAD/Attachment management permissions to push content. When enabled the URL <code>{{url_for("dotgit", _external=True)}}</code> will be displayed in the users settings.
        </div>
      </div>
    </div>
{##}
    <div class="form-group">
        <label for="sidebar_menutree_mode">WikiLink Style</label>
        <select class="form-control w-md-600" id="wikilink_style" name="wikilink_style">
{% for mode in [("", "[[Title | PageName]] - like Markdown links [Title](/PageName)"),("LINKTITLE","[[PageName | Title]] - compatibility mode"),] %}
            <option value="{{mode[0]}}"{%if config.WIKILINK_STYLE == mode[0] %} selected="selected"{%endif%}>{{mode[1]}}</option>
{% endfor %}
        </select>
        <div class="mt-5">
            The WikiLink Style only changes the rendering of the <code>[[Wikilink]]</code>, no content will be changed. The compatibility mode is for imported content or matching the style users got used to.
        </div>
    </div>
{##}
<div class="form-text pt-0 mt-0 mb-20"></div>
{##}
  <div class="mt-10">
    <input class="btn btn-primary" name="update_preferences" type="submit" value="Save Preferences">
  </div>
</form>
</div>
</div>
{% endblock %}
